package routers

import (
	"beego1/controllers"
	"github.com/astaxie/beego"
)

func init() {
	beego.Router("/", &controllers.MainController{})
	beego.Router("/test_httplib", &controllers.TestHttpLibControllers{}, "get:Get;post:Post")
	beego.Router("/get/?:id", &controllers.TestPostControllers{}, "get:Get") // 浏览器上只能模仿get请求
	beego.Router("/post", &controllers.TestPostControllers{}, "*:Get;post:Post")

	// testModel
	beego.Router("/test_model", &controllers.TestModelControllers{}, "get:Get;post:Post")
	// beego.Router("/post", func(ctx *context.Context) {
	// 	ctx.Output.Body([]byte{"hello hello hello"})
	// })
	
	// 调用crawlMovie
	beego.Router("/crawl_movie", &controllers.CrawlMovieController{}, "*:CrawlMovie")

	// beego journey begin
	beego.Router("/api/v1/register", &controllers.Register{}, "get:Reg")
	// beego.Router("/api/v1/login", &controllers.Login{}, "get:Get")

	// 表单数据验证
	beego.Router("/api/v1/validation", &controllers.Validation{})

	// 上传文件
	beego.Router("/api/v1/uploadFile", &controllers.UploadFile{})

	// 绑定数据
	beego.Router("/api/v1/databind", &controllers.Databind{})
}
